<%@ page import="java.util.UUID" %>
<%@ page import="com.java2007.hotel.pojo.Food" %>
<%@ page import="java.util.List" %>
<%@ page import="com.java2007.hotel.pojo.FoodType" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2021/1/25
  Time: 17:44
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <!-- 包含公共的JSP代码片段 -->

    <title>餐馆王平台</title>

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <script type="text/javascript" src="${pageContext.request.contextPath}/front/detail/style/js/jquery.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/front/detail/style/js/page_common.js"></script>
    <link href="${pageContext.request.contextPath}/front/detail/style/css/common_style_blue.css" rel="stylesheet" type="text/css">
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/front/detail/style/css/index_1.css" />
    <link href="${pageContext.request.contextPath}/front/detail/style/css/index.css" rel="stylesheet" type="text/css" />
</head>
<body style="text-align: center">
<div id="all">
    <div id="menu">
        <!-- 显示菜品的div -->
        <div id="top">
            <ul>
                <%
                    String uuid =  UUID.randomUUID().toString();
                    pageContext.setAttribute("uuid",uuid);
                %>

                <c:forEach items="${frontFoods}" var="frontFood" varStatus="status">

                    <li>
                        <dl>
                            <dt>
                                <a href=" ${pageContext.request.contextPath}/front/foodServlet?method=xiangFood&ciadanFoodId=${frontFood.id}">
                                    <img width="214px" height="145px" src="${pageContext.request.contextPath}/images/${frontFood.picture}?rand=${uuid}" />
                                </a>
                            </dt>
                            <dd class="f1">
                                <a href=" ${pageContext.request.contextPath}/front/foodServlet?method=xiangFood&ciadanFoodId=${frontFood.id}">${frontFood.name}</a>
                            </dd>
                            <dd class="f2">
                                <a href=" ${pageContext.request.contextPath}/front/foodServlet?method=xiangFood&ciadanFoodId=${frontFood.id}">
                                    <c:if test="${user.vipStatus==0}">${frontFood.price/100.0}</c:if>
                                    <c:if test="${user.vipStatus==1}">${frontFood.vipPrice/100.0}</c:if>
                                </a>
                            </dd>
                        </dl>
                    </li>
                </c:forEach>
            </ul>
        </div>

        <!-- 底部分页导航条div -->
        <div id="foot">
						<span style="float:left; line-height:53PX; margin-left:-50px; font-weight:bold; ">
							<a href="${pageContext.request.contextPath}/front/foodServlet?method=${navigation}&currentPageNo=${currentPageNo-1}&foodTypeId=${foodTypeId}&foodName=${foodName}"><span style="font-weight:bold">&lt;&lt;</span></a>
						</span>
            <div id="btn">
                <ul>
                    <c:forEach begin="1" end="${totalPageCount}" step="1" varStatus="status">
                        <li><a href="${pageContext.request.contextPath}/front/foodServlet?method=${navigation}&currentPageNo=${status.count}&foodTypeId=${foodTypeId}&foodName=${foodName}">${status.count}</a></li>
                    </c:forEach>
                </ul>
            </div>


            <span style="float:right; line-height:53px; margin-right:10px;  ">
                <a href="${pageContext.request.contextPath}/front/foodServlet?method=${navigation}&currentPageNo=${currentPageNo+1}&foodTypeId=${foodTypeId}&foodName=${foodName}" style=" text-decoration:none;color:#000000; font-weight:bold">&gt;&gt;</a>
            </span>
        </div>

    </div>

    <!-- 右边菜系列表，菜品搜索框  -->
    <div id="dish_class">
        <div id="dish_top">
            <ul>
                <li class="dish_num"></li>
                <li>
                    <a href="${pageContext.request.contextPath}/front/detailServlet?method=selectAll">
                        <!--查看清单列表-->

                        <img src=" ${pageContext.request.contextPath}/front/detail/style/images/call2.gif" />
                    </a>
                </li>
            </ul>
        </div>

        <!--			各种菜系-->
        <div id="dish_2">
            <ul>

                <c:forEach items="${foodTypes}" var="foodType" varStatus="status">
                    <li>
                        <a href="${pageContext.request.contextPath}/front/foodServlet?method=selectByFoodType&currentPageNo=1&foodTypeId=${foodType.id}">${foodType.name}</a>
                    </li>

                </c:forEach>

            </ul>
        </div>
        <div id="dish_3">
            <!-- 搜索菜品表单  -->
            <form action="${pageContext.request.contextPath}/front/foodServlet" method="post">
                <table width="166px">
                    <tr>
                        <td>
                            <input type="text" id="dish_name" name="foodName" class="select_value" value="${foodName}" />
                            <input type="hidden" value="selectFood" name="method">
                            <input type="hidden" value="1" name="currentPageNo">
                        </td>
                    </tr>
                    <tr>
                        <td><input type="submit" id="sub" value="" /></td>
                    </tr>
                    <tr>
                        <td>
                            <a href="${pageContext.request.contextPath}/front/foodServlet?method=selectAll&currentPageNo=1">
                                <img src="${pageContext.request.contextPath}/front/detail/style/images/look.gif" />
                            </a>
                        </td>
                    </tr>
                </table>
            </form>
        </div>
    </div>

</div>
</body>


</html>

